//
//  SeizureDetector.h
//  Seizure
//
// Given Accelerometer data, determines if the motion is seizure-like

#import <Foundation/Foundation.h>
#import <CoreMotion/CMMotionManager.h>
#import "DetectorUpdates.h"

@class AccelerometerFilter;

@interface SeizureDetector : NSObject <UIAccelerometerDelegate>
{
    id<DetectorUpdates> controllerReceivingUpdates;
    BOOL newDevice;
    
    //ACCELEROMTER VARS
    CMMotionManager *motionManager;
    AccelerometerFilter *filter;
    
    //DETECTION VARS
    NSMutableArray *intervalQueue;
    NSMutableArray *xcoords;
    NSMutableArray *ycoords;
    NSMutableArray *zcoords;
}

@property (strong, retain) id<DetectorUpdates> controllerReceivingUpdates;
@property (nonatomic, assign) BOOL newDevice;

//DETECTION PROPERTIES
@property (strong, retain) NSMutableArray *intervalQueue;
@property (strong, retain) NSMutableArray *xcoords;
@property (strong, retain) NSMutableArray *ycoords;
@property (strong, retain) NSMutableArray *zcoords;

//Initialization with delegate
- (id)initWithDelegate:(id<DetectorUpdates>)delegate;
- (void)changeFilter:(Class)filterClass;
- (void)setFilterSensitivity:(double)sensitivity;

//DETECTION METHODS
- (BOOL)detectSeizure;
- (BOOL)analyzeIntervals:(NSMutableArray*)intervals;

//ACCELEROMETER METHODS
- (void)startGettingData;
- (void)stopGettingData;

@end
